home *** CD-ROM | disk | FTP | other *** search
- /*
- * Blob Manager Demonstration: Window routines
- */
-
- # include "TransSkel.h"
-
- # include "BlobMgr.h"
- # include "BlobDemo.h"
-
-
-
- /*
- * Get a window for a demo module. Pass the resource number of the
- * window. Set the font to the System font, and add the window's
- * title to the Windows menu.
- *
- * The window is created using a color GrafPort if possible so that
- * better dimming can be done on monitors supporting grayscale.
- */
-
- WindowPtr
- GetDemoWind (short resNum)
- {
- WindowPtr w;
-
- if (SkelQuery (skelQHasColorQD))
- w = GetNewCWindow (resNum, nil, (WindowPtr) -1L);
- else
- w = GetNewWindow (resNum, nil, (WindowPtr) -1L);
- SetPort (w);
- TextFont (0);
- TextSize (0);
- return (w);
- }
-
-
- /*
- * Generic window handler clobber proc for TransSkel stuff
- */
-
- pascal void
- DoWClobber (void)
- {
- WindowPtr theWind;
-
- GetPort (&theWind);
- DisposeWindow (theWind);
- }
-
-
- /*
- * Set window's default blob dragging rects: limit rect is portRect
- * of window's grafPort, slop rect is wide open rectangle.
- */
-
- void
- SetDragRects (GrafPtr thePort)
- {
- Rect rSlop;
-
- SetRect (&rSlop, -30000, -30000, 30000, 30000);
- SetBDragRects (&thePort->portRect, &rSlop);
- }
-
-
- /*
- * Make a window the front window.
- */
-
- void
- MakeFrontWind (WindowPtr w)
- {
- SelectWindow (w);
- ShowWindow (w);
- SkelDoEvents (updateMask + activMask);
- }
-